class_name Helper
extends RefCounted


## 根据玩家的组获取到玩家对象，注意，参数 `tree` 应该是 `get_tree()`。
## 另外，调用此方法前确保 `Player` 已经挂载，故一般情况下应该放置在 `await get_tree().process_frame` 之后调用
static func find_player(tree: SceneTree) -> Player:
	var player := tree.get_first_node_in_group(GlobalConstants.Group.PLAYER_GROUP) as Player
	assert(player != null, "Not found player from the group named \"" + GlobalConstants.Group.PLAYER_GROUP + "\"")
	return player
